package com.xiaoyang.ssyx.minio;


import com.xiaoyang.ssyx.ServiceProductApplication;
import com.xiaoyang.ssyx.product.utils.MinioUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @AUTHOR XiaoYang
 * @DATE 2023/6/16-12:09
 * @DESCRIPTION TODO
 */
@SpringBootTest(classes = ServiceProductApplication.class)
@RunWith(SpringRunner.class)
public class MinioStudy {

    @Autowired
    private MinioUtil minioUtil;

    @Test
    public void test01(){

        boolean isSuccess = minioUtil.existBucket("ssyx-xiaoyang");
        ResponseEntity<byte[]> download = minioUtil.download("xiHongShi.png", "ssyx-xiaoyang");
        System.out.println("download = " + download);
        System.out.println("isSuccess = " + isSuccess);
    }


}
